home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / QuickTimeVRFormat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  14.4 KB  |  490 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QuickTimeVRFormat.h
  3.  
  4.      Contains:    QuickTime VR interfaces
  5.  
  6.      Version:    Technology:    QuickTime VR 2.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QUICKTIMEVRFORMAT__
  18. #define __QUICKTIMEVRFORMAT__
  19.  
  20. #ifndef __CONDITIONALMACROS__
  21. #include <ConditionalMacros.h>
  22. #endif
  23. #ifndef __DIALOGS__
  24. #include <Dialogs.h>
  25. #endif
  26. #ifndef __MOVIES__
  27. #include <Movies.h>
  28. #endif
  29. #ifndef __QUICKTIMEVR__
  30. #include <QuickTimeVR.h>
  31. #endif
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55.  
  56. /* File Format Version numbers */
  57. #define kQTVRMajorVersion (2)
  58. #define kQTVRMinorVersion (0)
  59.  
  60. /* User data type for the Movie Controller type specifier*/
  61.  
  62. enum {
  63.     kQTControllerType            = kQTVRControllerSubType,        /* Atom & ID of where our*/
  64.     kQTControllerID                = 1                                /* ...controller name is stored*/
  65. };
  66.  
  67. /* VRWorld atom types*/
  68.  
  69. enum {
  70.     kQTVRWorldHeaderAtomType    = FOUR_CHAR_CODE('vrsc'),
  71.     kQTVRImagingParentAtomType    = FOUR_CHAR_CODE('imgp'),
  72.     kQTVRPanoImagingAtomType    = FOUR_CHAR_CODE('impn'),
  73.     kQTVRObjectImagingAtomType    = FOUR_CHAR_CODE('imob'),
  74.     kQTVRNodeParentAtomType        = FOUR_CHAR_CODE('vrnp'),
  75.     kQTVRNodeIDAtomType            = FOUR_CHAR_CODE('vrni'),
  76.     kQTVRNodeLocationAtomType    = FOUR_CHAR_CODE('nloc'),
  77.     kQTVRCursorParentAtomType    = FOUR_CHAR_CODE('vrcp'),        /* New with 2.1*/
  78.     kQTVRCursorAtomType            = FOUR_CHAR_CODE('CURS'),        /* New with 2.1*/
  79.     kQTVRColorCursorAtomType    = FOUR_CHAR_CODE('crsr')        /* New with 2.1*/
  80. };
  81.  
  82. /* NodeInfo atom types*/
  83.  
  84. enum {
  85.     kQTVRNodeHeaderAtomType        = FOUR_CHAR_CODE('ndhd'),
  86.     kQTVRHotSpotParentAtomType    = FOUR_CHAR_CODE('hspa'),
  87.     kQTVRHotSpotAtomType        = FOUR_CHAR_CODE('hots'),
  88.     kQTVRHotSpotInfoAtomType    = FOUR_CHAR_CODE('hsin'),
  89.     kQTVRLinkInfoAtomType        = FOUR_CHAR_CODE('link')
  90. };
  91.  
  92. /* Miscellaneous atom types*/
  93.  
  94. enum {
  95.     kQTVRStringAtomType            = FOUR_CHAR_CODE('vrsg'),
  96.     kQTVRStringEncodingAtomType    = FOUR_CHAR_CODE('vrse'),        /* New with 2.1*/
  97.     kQTVRPanoSampleDataAtomType    = FOUR_CHAR_CODE('pdat'),
  98.     kQTVRObjectInfoAtomType        = FOUR_CHAR_CODE('obji'),
  99.     kQTVRImageTrackRefAtomType    = FOUR_CHAR_CODE('imtr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  100.     kQTVRHotSpotTrackRefAtomType = FOUR_CHAR_CODE('hstr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  101.     kQTVRAngleRangeAtomType        = FOUR_CHAR_CODE('arng'),
  102.     kQTVRTrackRefArrayAtomType    = FOUR_CHAR_CODE('tref'),
  103.     kQTVRPanConstraintAtomType    = FOUR_CHAR_CODE('pcon'),
  104.     kQTVRTiltConstraintAtomType    = FOUR_CHAR_CODE('tcon'),
  105.     kQTVRFOVConstraintAtomType    = FOUR_CHAR_CODE('fcon')
  106. };
  107.  
  108.  
  109. enum {
  110.     kQTVRObjectInfoAtomID        = 1,
  111.     kQTVRObjectImageTrackRefAtomID = 1,                            /* New with 2.1, it adds a track reference to select between multiple image tracks*/
  112.     kQTVRObjectHotSpotTrackRefAtomID = 1                        /* New with 2.1, it adds a track reference to select between multiple hotspot tracks*/
  113. };
  114.  
  115. /* Track reference types*/
  116.  
  117. enum {
  118.     kQTVRImageTrackRefType        = FOUR_CHAR_CODE('imgt'),
  119.     kQTVRHotSpotTrackRefType    = FOUR_CHAR_CODE('hott')
  120. };
  121.  
  122. /* Old hot spot types*/
  123.  
  124. enum {
  125.     kQTVRHotSpotNavigableType    = FOUR_CHAR_CODE('navg')
  126. };
  127.  
  128. /* Valid bits used in QTVRLinkHotSpotAtom*/
  129.  
  130. enum {
  131.     kQTVRValidPan                = 1L << 0,
  132.     kQTVRValidTilt                = 1L << 1,
  133.     kQTVRValidFOV                = 1L << 2,
  134.     kQTVRValidViewCenter        = 1L << 3
  135. };
  136.  
  137.  
  138. /* Values for flags field in QTVRPanoSampleAtom*/
  139.  
  140. enum {
  141.     kQTVRPanoFlagHorizontal        = 1L << 0,
  142.     kQTVRPanoFlagLast            = 1L << 31
  143. };
  144.  
  145.  
  146. /* Values for locationFlags field in QTVRNodeLocationAtom*/
  147.  
  148. enum {
  149.     kQTVRSameFile                = 0
  150. };
  151.  
  152.  
  153. /* Header for QTVR track's Sample Description record (vrWorld atom container is appended)*/
  154.  
  155. struct QTVRSampleDescription {
  156.     UInt32                             descSize;                    /* total size of the QTVRSampleDescription*/
  157.     UInt32                             descType;                    /* must be 'qtvr'*/
  158.  
  159.     UInt32                             reserved1;                    /* must be zero*/
  160.     UInt16                             reserved2;                    /* must be zero*/
  161.     UInt16                             dataRefIndex;                /* must be zero*/
  162.  
  163.     UInt32                             data;                        /* Will be extended to hold vrWorld QTAtomContainer*/
  164.  
  165. };
  166. typedef struct QTVRSampleDescription    QTVRSampleDescription;
  167. typedef QTVRSampleDescription *            QTVRSampleDescriptionPtr;
  168. typedef QTVRSampleDescriptionPtr *        QTVRSampleDescriptionHandle;
  169. /*
  170.   =================================================================================================
  171.    Definitions and structures used in the VRWorld QTAtomContainer
  172.   -------------------------------------------------------------------------------------------------
  173. */
  174.  
  175.  
  176. struct QTVRStringAtom {
  177.     UInt16                             stringUsage;
  178.     UInt16                             stringLength;
  179.     unsigned char                     theString[4];                /* field previously named "string"*/
  180. };
  181. typedef struct QTVRStringAtom            QTVRStringAtom;
  182. typedef QTVRStringAtom *                QTVRStringAtomPtr;
  183.  
  184.  
  185. struct QTVRWorldHeaderAtom {
  186.     UInt16                             majorVersion;
  187.     UInt16                             minorVersion;
  188.  
  189.     QTAtomID                         nameAtomID;
  190.     UInt32                             defaultNodeID;
  191.     UInt32                             vrWorldFlags;
  192.  
  193.     UInt32                             reserved1;
  194.     UInt32                             reserved2;
  195. };
  196. typedef struct QTVRWorldHeaderAtom        QTVRWorldHeaderAtom;
  197. typedef QTVRWorldHeaderAtom *            QTVRWorldHeaderAtomPtr;
  198.  
  199. /* Valid bits used in QTVRPanoImagingAtom*/
  200.  
  201. enum {
  202.     kQTVRValidCorrection        = 1L << 0,
  203.     kQTVRValidQuality            = 1L << 1,
  204.     kQTVRValidDirectDraw        = 1L << 2,
  205.     kQTVRValidFirstExtraProperty = 1L << 3
  206. };
  207.  
  208.  
  209. struct QTVRPanoImagingAtom {
  210.     UInt16                             majorVersion;
  211.     UInt16                             minorVersion;
  212.  
  213.     UInt32                             imagingMode;
  214.     UInt32                             imagingValidFlags;
  215.  
  216.     UInt32                             correction;
  217.     UInt32                             quality;
  218.     UInt32                             directDraw;
  219.     UInt32                             imagingProperties[6];        /* for future properties*/
  220.  
  221.     UInt32                             reserved1;
  222.     UInt32                             reserved2;
  223. };
  224. typedef struct QTVRPanoImagingAtom        QTVRPanoImagingAtom;
  225. typedef QTVRPanoImagingAtom *            QTVRPanoImagingAtomPtr;
  226.  
  227. struct QTVRNodeLocationAtom {
  228.     UInt16                             majorVersion;
  229.     UInt16                             minorVersion;
  230.  
  231.     OSType                             nodeType;
  232.     UInt32                             locationFlags;
  233.     UInt32                             locationData;
  234.  
  235.     UInt32                             reserved1;
  236.     UInt32                             reserved2;
  237. };
  238. typedef struct QTVRNodeLocationAtom        QTVRNodeLocationAtom;
  239. typedef QTVRNodeLocationAtom *            QTVRNodeLocationAtomPtr;
  240. /*
  241.   =================================================================================================
  242.    Definitions and structures used in the Nodeinfo QTAtomContainer
  243.   -------------------------------------------------------------------------------------------------
  244. */
  245.  
  246.  
  247. struct QTVRNodeHeaderAtom {
  248.     UInt16                             majorVersion;
  249.     UInt16                             minorVersion;
  250.  
  251.     OSType                             nodeType;
  252.     QTAtomID                         nodeID;
  253.     QTAtomID                         nameAtomID;
  254.     QTAtomID                         commentAtomID;
  255.  
  256.     UInt32                             reserved1;
  257.     UInt32                             reserved2;
  258. };
  259. typedef struct QTVRNodeHeaderAtom        QTVRNodeHeaderAtom;
  260. typedef QTVRNodeHeaderAtom *            QTVRNodeHeaderAtomPtr;
  261.  
  262. struct QTVRAngleRangeAtom {
  263.     Float32                         minimumAngle;
  264.     Float32                         maximumAngle;
  265. };
  266. typedef struct QTVRAngleRangeAtom        QTVRAngleRangeAtom;
  267. typedef QTVRAngleRangeAtom *            QTVRAngleRangeAtomPtr;
  268.  
  269. struct QTVRHotSpotInfoAtom {
  270.     UInt16                             majorVersion;
  271.     UInt16                             minorVersion;
  272.  
  273.     OSType                             hotSpotType;
  274.     QTAtomID                         nameAtomID;
  275.     QTAtomID                         commentAtomID;
  276.  
  277.     SInt32                             cursorID[3];
  278.  
  279.                                                                 /* canonical view for this hot spot*/
  280.     Float32                         bestPan;
  281.     Float32                         bestTilt;
  282.     Float32                         bestFOV;
  283.     QTVRFloatPoint                     bestViewCenter;
  284.  
  285.                                                                 /* Bounding box for this hot spot*/
  286.     Rect                             hotSpotRect;
  287.  
  288.     UInt32                             flags;
  289.     UInt32                             reserved1;
  290.     UInt32                             reserved2;
  291. };
  292. typedef struct QTVRHotSpotInfoAtom        QTVRHotSpotInfoAtom;
  293. typedef QTVRHotSpotInfoAtom *            QTVRHotSpotInfoAtomPtr;
  294.  
  295. struct QTVRLinkHotSpotAtom {
  296.     UInt16                             majorVersion;
  297.     UInt16                             minorVersion;
  298.  
  299.     UInt32                             toNodeID;
  300.  
  301.     UInt32                             fromValidFlags;
  302.     Float32                         fromPan;
  303.     Float32                         fromTilt;
  304.     Float32                         fromFOV;
  305.     QTVRFloatPoint                     fromViewCenter;
  306.  
  307.     UInt32                             toValidFlags;
  308.     Float32                         toPan;
  309.     Float32                         toTilt;
  310.     Float32                         toFOV;
  311.     QTVRFloatPoint                     toViewCenter;
  312.  
  313.     Float32                         distance;
  314.  
  315.     UInt32                             flags;
  316.     UInt32                             reserved1;
  317.     UInt32                             reserved2;
  318. };
  319. typedef struct QTVRLinkHotSpotAtom        QTVRLinkHotSpotAtom;
  320. typedef QTVRLinkHotSpotAtom *            QTVRLinkHotSpotAtomPtr;
  321. /*
  322.   =================================================================================================
  323.    Definitions and structures used in Panorama and Object tracks
  324.   -------------------------------------------------------------------------------------------------
  325. */
  326.  
  327.  
  328. struct QTVRPanoSampleAtom {
  329.     UInt16                             majorVersion;
  330.     UInt16                             minorVersion;
  331.  
  332.     UInt32                             imageRefTrackIndex;            /* track reference index of the full res image track*/
  333.     UInt32                             hotSpotRefTrackIndex;        /* track reference index of the full res hot spot track*/
  334.  
  335.     Float32                         minPan;
  336.     Float32                         maxPan;
  337.     Float32                         minTilt;
  338.     Float32                         maxTilt;
  339.     Float32                         minFieldOfView;
  340.     Float32                         maxFieldOfView;
  341.  
  342.     Float32                         defaultPan;
  343.     Float32                         defaultTilt;
  344.     Float32                         defaultFieldOfView;
  345.  
  346.                                                                 /* Info for highest res version of image track*/
  347.     UInt32                             imageSizeX;                    /* pixel width of the panorama (e.g. 768)*/
  348.     UInt32                             imageSizeY;                    /* pixel height of the panorama (e.g. 2496)*/
  349.     UInt16                             imageNumFramesX;            /* diced frames wide (e.g. 1)*/
  350.     UInt16                             imageNumFramesY;            /* diced frames high (e.g. 24)*/
  351.  
  352.                                                                 /* Info for highest res version of hotSpot track*/
  353.     UInt32                             hotSpotSizeX;                /* pixel width of the hot spot panorama (e.g. 768)*/
  354.     UInt32                             hotSpotSizeY;                /* pixel height of the hot spot panorama (e.g. 2496)*/
  355.     UInt16                             hotSpotNumFramesX;            /* diced frames wide (e.g. 1)*/
  356.     UInt16                             hotSpotNumFramesY;            /* diced frames high (e.g. 24)*/
  357.  
  358.     UInt32                             flags;
  359.     UInt32                             reserved1;
  360.     UInt32                             reserved2;
  361.  
  362. };
  363. typedef struct QTVRPanoSampleAtom        QTVRPanoSampleAtom;
  364. typedef QTVRPanoSampleAtom *            QTVRPanoSampleAtomPtr;
  365. /* Special resolution values for the Image Track Reference Atoms. Use only one value per track reference.*/
  366.  
  367. enum {
  368.     kQTVRFullTrackRes            = kQTVRFullRes,
  369.     kQTVRHalfTrackRes            = kQTVRHalfRes,
  370.     kQTVRQuarterTrackRes        = kQTVRQuarterRes,
  371.     kQTVRPreviewTrackRes        = 0x8000
  372. };
  373.  
  374.  
  375. struct QTVRTrackRefEntry {
  376.     UInt32                             trackRefType;
  377.     UInt16                             trackResolution;
  378.     UInt32                             trackRefIndex;
  379. };
  380. typedef struct QTVRTrackRefEntry        QTVRTrackRefEntry;
  381. /*
  382.   =================================================================================================
  383.    Object File format 2.0
  384.   -------------------------------------------------------------------------------------------------
  385. */
  386.  
  387. enum {
  388.     kQTVRObjectAnimateViewFramesOn = (1L << 0),
  389.     kQTVRObjectPalindromeViewFramesOn = (1L << 1),
  390.     kQTVRObjectStartFirstViewFrameOn = (1L << 2),
  391.     kQTVRObjectAnimateViewsOn    = (1L << 3),
  392.     kQTVRObjectPalindromeViewsOn = (1L << 4),
  393.     kQTVRObjectSyncViewToFrameRate = (1L << 5),
  394.     kQTVRObjectDontLoopViewFramesOn = (1L << 6),
  395.     kQTVRObjectPlayEveryViewFrameOn = (1L << 7),
  396.     kQTVRObjectStreamingViewsOn    = (1L << 8)
  397. };
  398.  
  399.  
  400. enum {
  401.     kQTVRObjectWrapPanOn        = (1L << 0),
  402.     kQTVRObjectWrapTiltOn        = (1L << 1),
  403.     kQTVRObjectCanZoomOn        = (1L << 2),
  404.     kQTVRObjectReverseHControlOn = (1L << 3),
  405.     kQTVRObjectReverseVControlOn = (1L << 4),
  406.     kQTVRObjectSwapHVControlOn    = (1L << 5),
  407.     kQTVRObjectTranslationOn    = (1L << 6)
  408. };
  409.  
  410.  
  411. enum {
  412.     kGrabberScrollerUI            = 1,                            /* "Object" */
  413.     kOldJoyStickUI                = 2,                            /*  "1.0 Object as Scene"     */
  414.     kJoystickUI                    = 3,                            /* "Object In Scene"*/
  415.     kGrabberUI                    = 4,                            /* "Grabber only"*/
  416.     kAbsoluteUI                    = 5                                /* "Absolute pointer"*/
  417. };
  418.  
  419.  
  420.  
  421. struct QTVRObjectSampleAtom {
  422.     UInt16                             majorVersion;                /* kQTVRMajorVersion*/
  423.     UInt16                             minorVersion;                /* kQTVRMinorVersion*/
  424.     UInt16                             movieType;                    /* ObjectUITypes*/
  425.     UInt16                             viewStateCount;                /* The number of view states 1 based*/
  426.     UInt16                             defaultViewState;            /* The default view state number. The number must be 1 to viewStateCount*/
  427.     UInt16                             mouseDownViewState;            /* The mouse down view state.   The number must be 1 to viewStateCount*/
  428.     UInt32                             viewDuration;                /* The duration of each view including all animation frames in a view*/
  429.     UInt32                             columns;                    /* Number of columns in movie*/
  430.     UInt32                             rows;                        /* Number rows in movie*/
  431.     Float32                         mouseMotionScale;            /* 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.*/
  432.     Float32                         minPan;                        /* Start   horizontal pan angle in degrees*/
  433.     Float32                         maxPan;                        /* End     horizontal pan angle in degrees*/
  434.     Float32                         defaultPan;                    /* Initial horizontal pan angle in degrees (poster view)*/
  435.     Float32                         minTilt;                    /* Start   vertical   pan angle in degrees*/
  436.     Float32                         maxTilt;                    /* End     vertical   pan angle in degrees*/
  437.     Float32                         defaultTilt;                /* Initial vertical   pan angle in degrees (poster view)    */
  438.     Float32                         minFieldOfView;                /* minimum field of view setting (appears as the maximum zoom effect) must be >= 1*/
  439.     Float32                         fieldOfView;                /* the field of view range must be >= 1*/
  440.     Float32                         defaultFieldOfView;            /* must be in minFieldOfView and maxFieldOfView range inclusive*/
  441.     Float32                         defaultViewCenterH;
  442.     Float32                         defaultViewCenterV;
  443.  
  444.     Float32                         viewRate;
  445.     Float32                         frameRate;
  446.     UInt32                             animationSettings;            /* 32 reserved bit fields*/
  447.     UInt32                             controlSettings;            /* 32 reserved bit fields*/
  448.  
  449. };
  450. typedef struct QTVRObjectSampleAtom        QTVRObjectSampleAtom;
  451. typedef QTVRObjectSampleAtom *            QTVRObjectSampleAtomPtr;
  452. #if OLDROUTINENAMES
  453.  
  454. typedef QTVRStringAtom                     VRStringAtom;
  455. typedef QTVRWorldHeaderAtom             VRWorldHeaderAtom;
  456. typedef QTVRPanoImagingAtom             VRPanoImagingAtom;
  457. typedef QTVRNodeLocationAtom             VRNodeLocationAtom;
  458. typedef QTVRNodeHeaderAtom                 VRNodeHeaderAtom;
  459. typedef QTVRAngleRangeAtom                 VRAngleRangeAtom;
  460. typedef QTVRHotSpotInfoAtom             VRHotSpotInfoAtom;
  461. typedef QTVRLinkHotSpotAtom             VRLinkHotSpotAtom;
  462. typedef QTVRPanoSampleAtom                 VRPanoSampleAtom;
  463. typedef QTVRTrackRefEntry                 VRTrackRefEntry;
  464. typedef QTVRObjectSampleAtom             VRObjectSampleAtom;
  465. #endif  /* OLDROUTINENAMES */
  466.  
  467.  
  468.  
  469.  
  470. #if PRAGMA_STRUCT_ALIGN
  471.     #pragma options align=reset
  472. #elif PRAGMA_STRUCT_PACKPUSH
  473.     #pragma pack(pop)
  474. #elif PRAGMA_STRUCT_PACK
  475.     #pragma pack()
  476. #endif
  477.  
  478. #ifdef PRAGMA_IMPORT_OFF
  479. #pragma import off
  480. #elif PRAGMA_IMPORT
  481. #pragma import reset
  482. #endif
  483.  
  484. #ifdef __cplusplus
  485. }
  486. #endif
  487.  
  488. #endif /* __QUICKTIMEVRFORMAT__ */
  489.  
  490.